#ifndef MPROCESS_H
#define MPROCESS_H

class mArrow;
class mText;

#include <QGraphicsPolygonItem>
#include <QGraphicsLineItem>
#include <QList>
#include <QMouseEvent>
#include<QString>
#include<Util/cstate.h>
QT_BEGIN_NAMESPACE
class QPixmap;
class QGraphicsItem;
class QGraphicsScene;
class QTextEdit;
class QGraphicsSceneMouseEvent;
class QMenu;
class QGraphicsSceneContextMenuEvent;
class QPainter;
class QWidget;
class QPolygonF;

QT_END_NAMESPACE

class mProcess : public QGraphicsPolygonItem
{

public:
    mProcess(int id, QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    enum { Type = UserType + 15 };

    int type() const
        { return Type;}

    void removeArrow(mArrow *arrow);

    QList<int> removeArrows();

    QPolygonF polygon() const
    { return myPolygon; }

    void addArrow(mArrow *arrow);

    int GetMyId()const{
        return myID;}

    void removeText(mText *textItem);
    void removeTexts();
    void addText(mText *textItem);
    void addInfo(CState *stateInfo);
    CState * getStateInfo();


protected:
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
               QWidget *widget = 0);

private:
    QPolygonF myPolygon;
    QList<mArrow *> arrows;
    QList<mText *> texts;
    int myID;
    CState *StateInfo;
};

#endif // MPROCESS_H
